package com.baofu.paycore.service.processor.account;

import com.baofu.paycore.manager.model.FreezeBO;
import com.baofu.paycore.manager.model.preAuth.PreAuthBO;
import com.baofu.paycore.service.converter.DTO2BOConverter;
import com.baofu.paycore.service.facade.model.AccountFreeze.FreezeDTO;
import com.baofu.paycore.service.facade.model.authorize.AuthorizeDTO;
import com.baofu.paycore.service.processor.PayBaseProcessor;
import com.system.commons.sequence.redis.SequenceFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * </p>
 * User:ames wang  Date: 2017/6/22
 */
@Service
public class FreezeProcessor implements PayBaseProcessor<FreezeBO, FreezeDTO>{

    /**
     * 资金明细单号生成
     */
    @Autowired
    private SequenceFacade sequenceFacade;
    /**
     * 支付内部对象构建
     *
     * @param freezeBO  支付模型
     * @param payBaseDTO 请求参数
     */
    @Override
    public PayBaseProcessor process(FreezeBO freezeBO, FreezeDTO payBaseDTO) {
        freezeBO.setFreezeNo(sequenceFacade.getUniqueSeq());
        DTO2BOConverter.payBaseBOConverter(payBaseDTO, freezeBO);
        DTO2BOConverter.freezeDTOToBO(payBaseDTO, freezeBO);
        return this;
    }
}
